package OOPAndMultiThreadArchiveManager.Client.Models;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.regex.Pattern;

public class User {
    public String name;
    public String password;

    @JsonIgnore
    public boolean isValid() {
        Pattern regex = Pattern.compile("^[a-zA-Z\\d._]{1,128}$");
        return regex.matcher(name).matches() && regex.matcher(password).matches();
    }
}